#include <bits/stdc++.h>
using namespace std;

int main(){
    int n,m,x,y,ans=0;
    cin>>n>>x>>y>>m;
    for (int i = x; i < x+m; ++i)
        for (int j = y; j < y+m; ++j)
            ans+=n*(i-1)+j;
    cout<<ans<<endl;
    return 0;
}